import os

# # 打开文件
# f = open("test.txt") # 文件路径 or 绝对路径
# path = os.getcwd()
# print("路径：",path)
#
# # 读取文件
# context = f.read()
# print(context)
#
# # 关闭文件
# f.close()


path = os.getcwd()
filename = path + '/test.txt'
f = open(filename,mode='r',encoding='utf-8')
f2 = open(filename,mode='r',encoding='gbk')
# 读取文件
# context = f.read()
# context = f.read(5)
# print(context)

# context = f.readline()
# print(context)

context = f.readlines()
print(context)

# 关闭文件
f.close()








